$(document).ready(function()
{
    /*
    if ( Modernizr.touch )
    {
        
    }else{
        //class for saving menu cookies
        var menu = {
            setCookie : function(key, value) {
                var expires = new Date();
                expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000));
                document.cookie = key + '=' + value + ';expires=' + expires.toUTCString();
            },
            getCookie : function(key) {
                var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');
                return keyValue ? keyValue[2] : null;
            }
        }

        // get current cookie
        var cookie = menu.getCookie('menu');

        //initialize menu
        var init_menu = function(){
            //if cookie is existing
            if(cookie){
                //do not slide up the ul that has an id
                $('ul.mini').not('ul#'+cookie).slideUp('slow');
            }else{
                //no saved cookie do not slide up the active
                $('ul.mini').not('ul.mini.active').slideUp('slow');
            }
        }

        //initialize the hide up on page load
        var dpc = setInterval(init_menu(), 1);
        //break the set interval
        clearInterval(dpc);

        // --- Accordion Function ---
        $('.accordion h3.head').click(function(e) {
            //save current clicked h3 > ul
            var that = $(this).next();
            //assign a value to menu first empty
            menu.setCookie('menu','');
            //assign the current clicked id
            menu.setCookie('menu',that.attr('id'));

            //toggle
            $(that).slideToggle('slow',function(){
                $(this).siblings('ul.mini').not(that).slideUp();
            });

            //stop normal execution
            e.preventDefault();
        });
    }
    */
});
